﻿using Modules.System.Dept;
using Modules.System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ManagementApi.Models;
using Modules.Corp;

namespace ManagementApi
{
    /// <summary>
    /// 企业信息局部扩展类
    /// </summary>
    public static partial class CorpInfoExceptions
    {
        /// <summary>
        /// 获取下拉
        /// </summary>
        /// <param name="depts"></param>
        /// <returns></returns>
        public static IEnumerable<VueTree<int>> AsOptions(this IEnumerable<CorpInfo> depts)
        {
            List<VueTree<int>> entityTrees = new();
            foreach (var item in depts)
            {
                VueTree<int> entityTree = new()
                {
                    Label = item.Name,
                    Value = item.CorpId
                };
                entityTrees.Add(entityTree);
            }
            return entityTrees;
        }
    }
}
